/*
SCUMMActionBar: This is the handler of the actions bar.
Controls the current selected action and contains the status bar
wich shows it.
*/
import SCUMMGameControl.SCUMMActionDescriptor;
import SCUMMCore.*;
import SCUMMCore.States.*;

class SCUMMGameControl.SCUMMDialogueMenu{
	var dg:Object;
	function SCUMMDialogueMenu(poDialogueBar:Object){
		//super(poDialogueBar);
		this.dg = poDialogueBar;
		this.dg.setStyle("fontSize", 12);
		this.dg.setStyle("fontFamily", "CaslonAntique");
		this.dg.setStyle("color", "0xFFFFFF");
		this.dg.setStyle("scrollTrackColor", "0x000000");
		this.dg.setStyle("headerHeight", 0);
		this.dg.setStyle("alternatingRowColors", ["0x000000", "0x000000"]);
		this.dg.setStyle("rollOverColor", "0x000001");
		this.dg.setStyle("selectionColor", "0x000000");
		this.dg.setStyle("selectionDuration", 300);
		this.dg.showHeaders = false;
		this.dg.editable = false;
	
		this.dg.dataProvider = _global.SCUMMGame.getCurrentDialogOptions();
		this.dg.removeColumnAt(1);
		var oSelfReference:Object = this.dg;
		var dgListener:Object = new Object();
		dgListener.cellPress = function(evt_obj:Object) {
			var cell_str:String = "(" + evt_obj.columnIndex + ", " + evt_obj.itemIndex + ")";
			oSelfReference.getItemAt(evt_obj.itemIndex)["action"](oSelfReference.getItemAt(evt_obj.itemIndex)["dialog"]);
		};
		// Add listener.
		this.dg.addEventListener("cellPress", dgListener);
	}
}